package com.guang.springbootrequestversion.controller;

import com.guang.springbootrequestversion.bean.Cat;
import com.guang.springbootrequestversion.bean.Person;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author liguang
 * @date 2022/5/13 10:06
 */
@Controller
public class ResponseBodyController {

    // 看看底层是怎么来进行操作的
    @ResponseBody
    @GetMapping(path = "person")
    public Person person(){
        Person person = new Person();
        person.setId(1);
        person.setSalary(100D);
        person.setName("lig");
        return person;
    }

    @ResponseBody
    @GetMapping(path = "cat")
    public Cat getCat(){
        Cat cat = new Cat();
        cat.setId(666);
        cat.setName("tom");
        return cat;
    }
}
